package br.dcc.ufmg.domain;

import java.sql.ResultSet;
import java.sql.SQLException;


public class Method extends Measure {
	
	private Class class_;
	
	private String name;
	
	public String getIdentifier() {
		return  "Source: " + class_.getSource() + ", Package: " + class_.getPackage_().getName() + ", Method: " + name;
	}
	
	public static Method createMethod(ResultSet rs)
			throws SQLException {
		Package package_ = new Package();
		package_.setName(rs.getString("package"));
		Class class_ = new Class();
		class_.setSource(rs.getString("source"));
		class_.setPackage_(package_);
		Method method = new Method();
		method.setClass_(class_);
		method.setName(rs.getString("name"));
		return method;
	}
	
	public Class getClass_() {
		return class_;
	}

	public void setClass_(Class class_) {
		this.class_ = class_;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

}
